﻿using Furion.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using Thor.Core;

namespace Thor.Application
{
    public class RoleService : IRoleService, ITransient
    {
        private readonly ISqlSugarRepository<Role> _roleRepository;

        public RoleService(ISqlSugarRepository<Role> roleRepository)
        {
            _roleRepository = roleRepository;
        }

        [Transactional]
        public async Task add(Role entity)
        {
            await _roleRepository.InsertAsync(entity);
            //throw new Exception("测试事务");
        }

    }
}
